package com.cskaoyan.mall.search.mq;

import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class ProductOffSaleConsumer {

    DefaultMQPushConsumer consumer;

    @Value("${rocketmq.namesrv.addr}")
    String nameserverAddress;

    @Value("${rocketmq.consumer.group}")
    String consumerGroup;

    @PostConstruct
    public void init() {
        // 创建consumer对象
        consumer = new DefaultMQPushConsumer(consumerGroup + "_offsale");
    }
}
